package edu.sctu.practice.class01.wangfuxin.day20151014homework.assign02;

/**
 * Created by 鑫爷您慢点 on 2015/10/14.
 */
public class Rational {
    public double rational;

    public Rational(double rational){
        this.rational = rational;
    }

    public double add(double rational1,double rational2){
        return rational1+rational2;
    }
    public double less(double rational1,double rational2){
        return rational1-rational2;
    }
    public double multiply(double rational1,double rational2){
        return rational1*rational2;
    }
    public double division(double rational1,double rational2){
        return rational1/rational2;
    }

    public static void main(String[] args) {
        Rational rational_one = new Rational(22.4);
        Rational rational_tow = new Rational(2);
        System.out.println("两数相加"+rational_one.add(rational_one.rational,rational_tow.rational));
        System.out.println("两数相减"+rational_one.less(rational_one.rational,rational_tow.rational));
        System.out.println("两数相乘"+rational_one.multiply(rational_one.rational,rational_tow.rational));
        System.out.println("两数相除"+rational_one.division(rational_one.rational,rational_tow.rational));
    }

}
